/**
 * 双指针
 * @param {character[]} s
 * @return {void} Do not return anything, modify s in-place instead.
 */
export var reverseString = function (s) {
  let left = 0
  let right = s.length - 1
  while (left < right) {
    ;[s[left], s[right]] = [s[right], s[left]]
    left++
    right--
  }
}

/**
 * 直接使用Array.reverse方法
 * @param {character[]} s
 * @return {void} Do not return anything, modify s in-place instead.
 */
export var reverseString2 = function (s) {
  s.reverse()
}
